<!DOCTYPE html>
<head>
<title>Image link test</title>
<script>
if (window.testRunner)
    testRunner.dumpAsText();
</script>
</head>
<body>

<h2>Image link in the presence of inline continuations</h2>

<p>This test checks that the right accessibility tree is generated for a link inside an image</p>

  <a id="test" href="http://www.wowhead.com/?item=33924"><img alt="Delicious cake" src="resources/cake.png"></a>

  <div id="result"></div>

<script>
function axTree(elt)
{
    var result = elt.allAttributes() + "\n\n";
    var count = elt.childrenCount;
    for (var i = 0; i < count; ++i) {
        result += "Child " + i + ":\n" + axTree(elt.childAtIndex(i));
    }
    return result;
}

window.onload = function () {
    if (window.accessibilityController) {
        var result = document.getElementById("result");
        document.getElementById("test").focus();
        result.innerText += axTree(accessibilityController.focusedElement);
    }
}
</script>
</body>
